import cv,cv2
import wx

class ShowCapture(wx.Panel):
    def __init__(self, parent, slidermin, slidermax, fps=15):
        wx.Panel.__init__(self, parent)
        #self.maximo = slidermax
        #self.minimo = slidermin
        #self.capture = cv2.VideoCapture(0)
        #self.capture.set(cv.CV_CAP_PROP_FRAME_WIDTH, 640)
        #self.capture.set(cv.CV_CAP_PROP_FRAME_HEIGHT, 480)
        #ret, frame = self.capture.read()
        
        #height, width = frame.shape[:2]
        #parent.SetSize((width, height))
        #frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)

        #self.bmp = wx.BitmapFromBuffer(width, height, frame)

        #self.timer = wx.Timer(self)
        #self.timer.Start(1000./fps)

        #self.Bind(wx.EVT_PAINT, self.OnPaint)
        #self.Bind(wx.EVT_TIMER, self.NextFrame)


    def OnPaint(self, evt):
        dc = wx.BufferedPaintDC(self)
        #dc.DrawBitmap(self.bmp, 0, 0)

    def NextFrame(self, event):
		pass
        #ret, img2 = self.capture.read()
        #img2 = cv2.cvtColor(self.capture.read()[1], cv2.COLOR_RGB2GRAY)
        #frame = cv2.Canny(img2,self.minimo.GetValue(),self.maximo.GetValue())
        #if ret:
        #frame = cv2.cvtColor(frame, cv2.COLOR_GRAY2RGB)
        #self.bmp.CopyFromBuffer(frame)
        #self.Refresh()
